Skip to content

ci: restore xdist coverage reporting#70

Merged
maltsev-dev merged 1 commit into
masterfrom
ci/fix-codecov-xdist
Jul 20, 2026
Merged

ci: restore xdist coverage reporting#70
maltsev-dev merged 1 commit into
masterfrom
ci/fix-codecov-xdist

Conversation

@maltsev-dev

Copy link
Copy Markdown
Member

Summary

  • run coverage through pytest-cov so each xdist worker contributes hit data
  • emit an explicit coverage.xml and fail CI when Codecov upload fails
  • align the local coverage floor with the existing 80% Codecov project target
  • replace the unsupported PyPI total-downloads badge route with monthly downloads

Root cause

coverage run -m pytest -n auto traced only the pytest coordinator. Tests executed in xdist workers, so Codecov received a report with zero hits even though the suite passed.

Verification

  • pytest -n auto --cov=src/nullrun --cov-branch --cov-report=xml:coverage.xml --cov-report=term: 1237 passed, 7 skipped; 80.87% combined coverage; required 80% reached
  • ruff check src/: passed
  • mypy src/: passed
  • TOML/YAML parsing and git diff --check: passed
  • monthly downloads badge: downloads: 370/month

Release impact

No runtime/package behavior change. This is CI and README metadata only, so no package version bump or release changelog entry is required.

Run pytest-cov inside xdist workers so Codecov receives real hit data instead of a coordinator-only 0% report. Align the local project floor with Codecov's existing 80% target, fail the job on upload errors, and restore the supported monthly PyPI downloads badge.
@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@maltsev-dev
maltsev-dev merged commit 29caae9 into master Jul 20, 2026
5 checks passed
maltsev-dev added a commit that referenced this pull request Jul 21, 2026
* ci: neutralise time.sleep in test code for coverage runs

Sprint 0 (coverage). Coverage is now reported correctly via
pytest-cov + xdist, but a handful of TestCircuitBreaker tests
use bare time.sleep(1.1) to wait out the 1.0s recovery_timeout.
That was a 3.3-second tax per worker on every xdist run, and
the suite could not be collected on Windows in a reasonable
time without the cap. The conftest autouse fixture
_fast_sleep caps test sleeps at 1ms, which is well above
the cancellable-wait regression threshold (0.05s) and zero
impact on retries (the existing per-test monkeypatch covers
the time.monotonic path).

Three TestCircuitBreaker tests now advance the wall clock
via _advance_clock(monkeypatch) instead of sleeping, so the
recovery transition fires deterministically.

Opt-out: @pytest.mark.slow_sleep on a test class keeps
the real wall clock (e.g. test_ping_chain_emits_heartbeats_on_time_schedule
needs real-time progression for the scheduler thread).

Verified: 1237 passed, 7 skipped, 29 warnings in 34.92s;
combined coverage 80.98% (vs 79.26% on master 29caae9).

* chore(release): 0.13.12 — CI / coverage-testability

Bump SDK 0.13.11 -> 0.13.12. CI scope only — no on-wire change,
no SDK_MIN_VERSION bump, no public API change. Backends on 1.0.0
keep working unchanged.

Pyproject version + __version__ + CHANGELOG entry. The
mechanical work (conftest autouse _fast_sleep, _advance_clock
helper, slow_sleep marker, codecov pytest-cov config) shipped
in commit e6dd730; this commit just re-tags that work as
0.13.12 so the published wheel exposes the new version string.

Verified: 1237 passed, 7 skipped, 29 warnings; combined coverage
80.87% (vs master 29caae9 79.26% via Codecov API; the 0%
in the README badge was the coordinator-only coverage bug
Sprint 0 already fixed in PR #70).
@maltsev-dev
maltsev-dev deleted the ci/fix-codecov-xdist branch July 24, 2026 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant